verify

abstract suspend fun verify(jwtSignatureVerifier: JwtSignatureVerifier<JWT>, unverifiedSdJwt: String): Result<SdJwt<JWT>>(source)

Verifies an SD-JWT serialized using compact serialization.

Typically, this is useful to Holder that wants to verify an issued SD-JWT, or to Verifier that wants to verify a presented SD-JWT in case the KB-JWT must not be present.

Return

the verified SD-JWT, if valid. Otherwise, method could raise a SdJwtVerificationException The verified SD-JWT will contain a JWT as both string and decoded payload

Parameters

jwtSignatureVerifier

the verification the SD-JWT signature. To provide an implementation of this, Holder should be aware of the public key and the signing algorithm that the Issuer used to sign the SD-JWT

unverifiedSdJwt

the SD-JWT to be verified


open suspend fun verify(jwtSignatureVerifier: JwtSignatureVerifier<JWT>, unverifiedSdJwt: JsonObject): Result<SdJwt<JWT>>(source)

Verifies an SD-JWT serialized using JWS JSON serialization (either general or flattened format) as defined by RFC7515 and extended by SD-JWT specification.

Typically, this is useful to Holder that wants to verify an issued SD-JWT, or to Verifier that wants to verify a presented SD-JWT in case the KB-JWT must not be present.

Return

the verified SD-JWT, if valid. Otherwise, method could raise a SdJwtVerificationException The verified SD-JWT will contain a JWT as both string and decoded payload

Parameters

jwtSignatureVerifier

the verification the SD-JWT signature. To provide an implementation of this, Holder should be aware of the public key and the signing algorithm that the Issuer used to sign the SD-JWT

unverifiedSdJwt

the SD-JWT to be verified. A JSON Object that is expected to be in general or flatten form as defined in RFC7515 and extended by SD-JWT specification.


abstract suspend fun verify(jwtSignatureVerifier: JwtSignatureVerifier<JWT>, keyBindingVerifier: KeyBindingVerifier.MustBePresentAndValid<JWT>, unverifiedSdJwt: String): Result<SdJwtAndKbJwt<JWT>>(source)

Verifies a SD-JWT+KB serialized using compact serialization.

Typically, this is useful to Verifiers that want to verify presentation SD-JWT communicated by Holders.

Return

the verified SD-JWT and the KeyBinding JWT, if valid. Otherwise, method could raise a SdJwtVerificationException The verified SD-JWT will the JWT and KeyBinding JWT are representing in both string and decoded payload. Expected errors are reported via a SdJwtVerificationException

Parameters

jwtSignatureVerifier

the verification of SD-JWT signature. To provide an implementation of this, Verifier should be aware of the public key and the signing algorithm that the Issuer used to sign the SD-JWT.

keyBindingVerifier

the verification of the KeyBinding signature Verifier should be aware of how the Issuer has chosen to include the Holder public key into the SD-JWT and which algorithm the Holder used to sign the challenge of the Verifier.

unverifiedSdJwt

the SD-JWT to be verified


open suspend fun verify(jwtSignatureVerifier: JwtSignatureVerifier<JWT>, keyBindingVerifier: KeyBindingVerifier.MustBePresentAndValid<JWT>, unverifiedSdJwt: JsonObject): Result<SdJwtAndKbJwt<JWT>>(source)

Verifies a SD-JWT+KB in JWS JSON serialization.

Typically, this is useful to Verifiers that want to verify presentation SD-JWT communicated by Holders

Return

the verified SD-JWT and KeyBinding JWT, if valid. Otherwise, method could raise a SdJwtVerificationException The verified SD-JWT will the JWT and KeyBinding JWT are representing in both string and decoded payload. Expected errors are reported via a SdJwtVerificationException

Parameters

jwtSignatureVerifier

the verification of SD-JWT signature. To provide an implementation of this, Verifier should be aware of the public key and the signing algorithm that the Issuer used to sign the SD-JWT.

keyBindingVerifier

the verification of the KeyBinding signature Verifier should be aware of how the Issuer has chosen to include the Holder public key into the SD-JWT and which algorithm the Holder used to sign the challenge of the Verifier.

unverifiedSdJwt

the SD-JWT to be verified